package com.brainshare.an.service.impl;

import java.util.List;

import com.brainshare.an.domain.AnMechanism;
import com.brainshare.an.mapper.AnMechanismMapper;
import com.brainshare.an.service.IAnMechanismService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 机构Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-11-05
 */
@Service
public class AnMechanismServiceImpl implements IAnMechanismService
{
    @Autowired
    private AnMechanismMapper anMechanismMapper;

    /**
     * 查询机构
     * 
     * @param mechanismId 机构主键
     * @return 机构
     */
    @Override
    public AnMechanism selectAnMechanismByMechanismId(Long mechanismId)
    {
        return anMechanismMapper.selectAnMechanismByMechanismId(mechanismId);
    }

    /**
     * 查询机构列表
     * 
     * @param anMechanism 机构
     * @return 机构
     */
    @Override
    public List<AnMechanism> selectAnMechanismList(AnMechanism anMechanism)
    {
        return anMechanismMapper.selectAnMechanismList(anMechanism);
    }

    /**
     * 新增机构
     * 
     * @param anMechanism 机构
     * @return 结果
     */
    @Override
    public int insertAnMechanism(AnMechanism anMechanism)
    {
        int insertAnMechanism = anMechanismMapper.insertAnMechanism(anMechanism);
        return insertAnMechanism;
    }

    /**
     * 修改机构
     * 
     * @param anMechanism 机构
     * @return 结果
     */
    @Override
    public int updateAnMechanism(AnMechanism anMechanism)
    {
        int updateAnMechanism = anMechanismMapper.updateAnMechanism(anMechanism);
        return updateAnMechanism;
    }

    /**
     * 批量删除机构
     * 
     * @param mechanismIds 需要删除的机构主键
     * @return 结果
     */
    @Override
    public int deleteAnMechanismByMechanismIds(Long[] mechanismIds)
    {
        return anMechanismMapper.deleteAnMechanismByMechanismIds(mechanismIds);
    }

    /**
     * 删除机构信息
     * 
     * @param mechanismId 机构主键
     * @return 结果
     */
    @Override
    public int deleteAnMechanismByMechanismId(Long mechanismId)
    {
        return anMechanismMapper.deleteAnMechanismByMechanismId(mechanismId);
    }
}
